\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p}{}\section{Introduction\+To\+Algorithm\+:\+:Graph\+Algorithm\+:\+:Vertex\+P$<$ K\+Type $>$ Struct Template Reference}
\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P$<$ K\+Type $>$@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P$<$ K\+Type $>$}}


Vertex\+P：图的顶点，它带一个parent属性，算法导论22章22.1节  




{\ttfamily \#include $<$vertexp.\+h$>$}

Inheritance diagram for Introduction\+To\+Algorithm\+:\+:Graph\+Algorithm\+:\+:Vertex\+P$<$ K\+Type $>$\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef K\+Type \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa48c040b6a076ae4e1cbd5cd51f42241}{Key\+Type}
\item 
typedef int \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa15e0b509772ea84c9b5a211079d641b}{V\+I\+D\+Type}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_a695048962ddb2a044ff450dc17b7001e}{Vertex\+P} ()
\begin{DoxyCompactList}\small\item\em 默认构造函数 \end{DoxyCompactList}\item 
\hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_afc46e0e4db66ca6dbabd85ea872d7239}{Vertex\+P} (const \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_a14e958c58a404474853491eb811954cc}{Key\+Type} \&k)
\begin{DoxyCompactList}\small\item\em 显式构造函数，指定{\ttfamily key} \end{DoxyCompactList}\item 
\hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa170e385f494f36442888addfadbc711}{Vertex\+P} (const \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_a14e958c58a404474853491eb811954cc}{Key\+Type} \&k, \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_a290c84c0dcf159f833c72c47a2d4d44a}{V\+I\+D\+Type} d)
\begin{DoxyCompactList}\small\item\em 显式构造函数，指定{\ttfamily key}和编号 \end{DoxyCompactList}\item 
virtual std\+::string \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_a86c8284b603498264ea040ddb0a7065f}{to\+\_\+string} () const 
\begin{DoxyCompactList}\small\item\em to\+\_\+string：返回顶点的字符串描述 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
std\+::shared\+\_\+ptr$<$ \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p}{Vertex\+P} $>$ \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_ad7af59de5b07b0f26de28e9085b710ea}{parent}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename K\+Type$>$struct Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P$<$ K\+Type $>$}

Vertex\+P：图的顶点，它带一个parent属性，算法导论22章22.1节 

它继承自\+Vertex，区别在于多了一个parent成员变量 

Definition at line 31 of file vertexp.\+h.



\subsection{Member Typedef Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa48c040b6a076ae4e1cbd5cd51f42241}{}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}!Key\+Type@{Key\+Type}}
\index{Key\+Type@{Key\+Type}!Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}}
\subsubsection[{Key\+Type}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type$>$ typedef K\+Type {\bf Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}$<$ K\+Type $>$\+::{\bf Key\+Type}}\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa48c040b6a076ae4e1cbd5cd51f42241}
顶点存储数据的类型 

Definition at line 33 of file vertexp.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa15e0b509772ea84c9b5a211079d641b}{}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}!V\+I\+D\+Type@{V\+I\+D\+Type}}
\index{V\+I\+D\+Type@{V\+I\+D\+Type}!Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}}
\subsubsection[{V\+I\+D\+Type}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type$>$ typedef int {\bf Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}$<$ K\+Type $>$\+::{\bf V\+I\+D\+Type}}\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa15e0b509772ea84c9b5a211079d641b}
顶点编号的数据类型 

Definition at line 34 of file vertexp.\+h.



\subsection{Constructor \& Destructor Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_a695048962ddb2a044ff450dc17b7001e}{}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}!Vertex\+P@{Vertex\+P}}
\index{Vertex\+P@{Vertex\+P}!Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}}
\subsubsection[{Vertex\+P()}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type$>$ {\bf Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}$<$ K\+Type $>$\+::{\bf Vertex\+P} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_a695048962ddb2a044ff450dc17b7001e}


默认构造函数 



Definition at line 37 of file vertexp.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_afc46e0e4db66ca6dbabd85ea872d7239}{}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}!Vertex\+P@{Vertex\+P}}
\index{Vertex\+P@{Vertex\+P}!Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}}
\subsubsection[{Vertex\+P(const Key\+Type \&k)}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type$>$ {\bf Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}$<$ K\+Type $>$\+::{\bf Vertex\+P} (
\begin{DoxyParamCaption}
\item[{const {\bf Key\+Type} \&}]{k}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [explicit]}}\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_afc46e0e4db66ca6dbabd85ea872d7239}


显式构造函数，指定{\ttfamily key} 


\begin{DoxyParams}{Parameters}
{\em k\+:顶点存放的数据} & \\
\hline
\end{DoxyParams}


Definition at line 42 of file vertexp.\+h.

\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa170e385f494f36442888addfadbc711}{}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}!Vertex\+P@{Vertex\+P}}
\index{Vertex\+P@{Vertex\+P}!Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}}
\subsubsection[{Vertex\+P(const Key\+Type \&k, V\+I\+D\+Type d)}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type$>$ {\bf Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}$<$ K\+Type $>$\+::{\bf Vertex\+P} (
\begin{DoxyParamCaption}
\item[{const {\bf Key\+Type} \&}]{k, }
\item[{{\bf V\+I\+D\+Type}}]{d}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_aa170e385f494f36442888addfadbc711}


显式构造函数，指定{\ttfamily key}和编号 


\begin{DoxyParams}{Parameters}
{\em k\+:顶点存放的数据} & \\
\hline
{\em d\+:顶点的编号} & \\
\hline
\end{DoxyParams}


Definition at line 48 of file vertexp.\+h.



\subsection{Member Function Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_a86c8284b603498264ea040ddb0a7065f}{}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}!to\+\_\+string@{to\+\_\+string}}
\index{to\+\_\+string@{to\+\_\+string}!Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}}
\subsubsection[{to\+\_\+string() const }]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type$>$ virtual std\+::string {\bf Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}$<$ K\+Type $>$\+::to\+\_\+string (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_a86c8284b603498264ea040ddb0a7065f}


to\+\_\+string：返回顶点的字符串描述 

\begin{DoxyReturn}{Returns}
\+:顶点的字符串描述
\end{DoxyReturn}
依次输出顶点的{\ttfamily id}、{\ttfamily key}、{\ttfamily parent}信息。 

Reimplemented from \hyperlink{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_aa8b0ab227cd3945eace9ef55f8837925}{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex$<$ K\+Type $>$}.



Definition at line 56 of file vertexp.\+h.



\subsection{Member Data Documentation}
\hypertarget{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_ad7af59de5b07b0f26de28e9085b710ea}{}\index{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}!parent@{parent}}
\index{parent@{parent}!Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P@{Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}}
\subsubsection[{parent}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename K\+Type$>$ std\+::shared\+\_\+ptr$<${\bf Vertex\+P}$>$ {\bf Introduction\+To\+Algorithm\+::\+Graph\+Algorithm\+::\+Vertex\+P}$<$ K\+Type $>$\+::parent}\label{struct_introduction_to_algorithm_1_1_graph_algorithm_1_1_vertex_p_ad7af59de5b07b0f26de28e9085b710ea}
顶点的父顶点的强指针 

Definition at line 64 of file vertexp.\+h.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
src/graph\+\_\+algorithms/basic\+\_\+graph/graph\+\_\+representation/graph\+\_\+vertex/\hyperlink{vertexp_8h}{vertexp.\+h}\end{DoxyCompactItemize}
